<section <?if(!$ajax):?>class="container"<?endif;?>>
    <?
    $form = $this->beginWidget ( 'application.widgets.ActiveForm', array (
        'id' => 'albumForm',
        'enableClientValidation' => true,
    	'action' => $this->createUrl('/album/create'),
        'htmlOptions' => array (
            'class'	=> 'form-horizontal mb0' . (!$ajax ? ' well' : ''),
        )
    ) );
    ?>
    <?if(!$ajax):?><legend>创建相册</legend><?endif;?>
    <fieldset>
	    <div class="alert alert-info">请先创建作者提示问题.方便下次确认身份管理该相册.</div>
	    <div class="control-group <?=$album->hasErrors('title') ? 'error' : '';?>">
	        <?=$form->labelEx($album, 'title', array('class' => 'control-label'))?>
	        <dd class="controls">
	            <?=$form->textField($album, 'title')?>
	            <?=$form->error($album, 'title', array('class' => 'help-inline'))?>
	        </dd>
	    </div>
	    <div class="control-group <?=$album->hasErrors('authorQuestion') ? 'error' : '';?>">
	        <?=$form->labelEx($album, 'authorQuestion', array('class' => 'control-label'))?>
	        <dd class="controls">
	            <?=$form->dropDownList($album, 'authorQuestion')?>
	            <?=$form->error($album, 'authorQuestion', array('class' => 'help-inline'))?>
	        </dd>
	    </div>
	    <div class="control-group <?=$album->hasErrors('authorAnswer') ? 'error' : '';?>">
	        <?=$form->labelEx($album, 'authorAnswer', array('class' => 'control-label'))?>
	        <dd class="controls">
	            <?=$form->textField($album, 'authorAnswer')?>
	            <?=$form->error($album, 'authorAnswer', array('class' => 'help-inline'))?>
	        </dd>
	    </div>
	    <div class="form-actions mb0">
	        <?=CHtml::submitButton('提交', array('id' => 'createBtn','class' => 'btn btn-tall btn-wide btn-primary'))?>
	    </div>
    </fieldset>
    <? $this->endWidget();?>
</section>
<?php 
$script = <<<EOT
Core.use('global', function(){
	//表单提交时按钮不可以用
	var createBtn = $('#createBtn')
	createBtn.click(function(){
		Core.Util.btnDisable(createBtn);
	});
});
EOT;
Yii::app()->clientScript->registerScript($this->id, $script);
?>
